package com.songcha.sakura.ui.adapter


import android.os.Bundle
import androidx.fragment.app.*
import com.songcha.sakura.bean.ComicListBean
import com.songcha.sakura.mvvm.home.scheduleWeek.HomeScheduleWeekFragment
import com.songcha.sakura.struct.ComicListBundleData



 class HomeScheduleAdapter(fm:FragmentManager, val list:MutableList<MutableList<ComicListBean.ComicBean>>) : FragmentStatePagerAdapter(fm) {
     override fun getCount(): Int {
        return list.size
     }

     override fun getItem(position: Int): Fragment {
         val fragment=HomeScheduleWeekFragment()
         val bundle=Bundle()
         val data=ComicListBundleData()
         data.data=list[position]
         bundle.putSerializable("list",data)
         fragment.arguments=bundle
         return fragment
     }

     override fun getPageTitle(position: Int): CharSequence? {
         when(position){
             0 -> return "周一"
             1 -> return "周二"
             2 -> return "周三"
             3 -> return "周四"
             4 -> return "周五"
             5 -> return "周六"
             6 -> return "周日"
         }
         return "周一"
     }




 }


